1) Field of the Invention
The present invention relates to an image encoder and an image encoding method for encoding moving images, and in particular to an image encoder and an image encoding method which can attach information unique to a frame (e.g., information indicating a scene change) to encoded data.
2) Description of the Related Art
In recent years, it has become common practice to handle moving images in a form of digital data by using compressive encoding such as MPEG (Moving Picture Expert Group). Such digital data representing moving images (moving-image data) are used for recording the moving images in various recording mediums or transmitting the moving images through networks. Conventionally, scene-change information indicating a time at which a record of an image starts or scenes are changed is attached to the moving-image data. For example, when a moving image is reproduced based on moving-image data, the scene-change information is used in a search for a time at which scenes are changed, generation of a thumbnail image, or the like.
For example, Japanese Unexamined Patent Publication No. 2000-115665 (Paragraphs [0014] to [0032] and FIG. 1) discloses an image-recording device which can detect a scene change from moving-image data, and attach scene-change information to the data. In the disclosed image-recording device, a buffer memory holds data for two precedingly inputted frames at all times, a scene-change detection circuit detects whether or not a scene change occurs, based on the current frame and the two precedingly inputted frames, and a scene-change attachment circuit attaches information indicating a scene change to system information when a scene change is detected. In addition, a switch selectively outputs one of the data to which the information indicating a scene change is attached and data to which information indicating a scene change is not attached, according to whether or not a scene change occurs.
In addition, recently, use of devices for compressively encoding image signals and recording the encoded image signals in a recording medium such as an optical disk has widely spread, where the image signals are, for example, television image signals received through an antenna or image signals inputted externally. In such devices, attachment of scene-change information is being considered. For example, in the devices which perform compressive MPEG encoding, a frame memory temporarily stores inputted image signals, and an encoding unit successively reads and compressively encodes the temporarily stored image signals frame by frame or field by field so as to produce a video stream. Finally, a multiplex unit multiplexes the video stream and an audio stream and the like so as to produce an MPEG stream, which is then recorded in a recording medium.
In order to attach scene-change information during generation of an MPEG stream, it is possible to detect presence or absence of a scene change based on the data stored in a frame memory in a preceding stage in the encoding unit, and record, by the multiplex unit, information indicating the scene change in an option field or the like in a header.
However, since the MPEG technique uses the variable-length encoding, the amount of data of the video stream generated per unit time is variable, the timings of the multiplexing of respective frames are not periodical. Therefore, when the scene change is detected and the scene-change information is recorded in the above manner, the time taken from the detection of the scene change to the recording of the scene-change information irregularly fluctuates, and thus it is difficult to accurately insert the scene-change information in a header of a packet containing a leading portion of data for an objective frame at which a scene change occurs.